/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "specialite")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Specialite.findAll", query = "SELECT s FROM Specialite s"),
    @NamedQuery(name = "Specialite.findBySpecialite", query = "SELECT s FROM Specialite s WHERE s.specialite = :specialite"),
    @NamedQuery(name = "Specialite.findByNiveauUniversitaire", query = "SELECT s FROM Specialite s WHERE s.niveauUniversitaire = :niveauUniversitaire")})
public class Specialite implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "SPECIALITE")
    private String specialite;
    @Basic(optional = false)
    @Column(name = "NIVEAU_UNIVERSITAIRE")
    private String niveauUniversitaire;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "specialite1")
    private Collection<Etudier> etudierCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "specialite1")
    private Collection<Exiger4> exiger4Collection;

    public Specialite() {
    }

    public Specialite(String specialite) {
        this.specialite = specialite;
    }

    public Specialite(String specialite, String niveauUniversitaire) {
        this.specialite = specialite;
        this.niveauUniversitaire = niveauUniversitaire;
    }

    public String getSpecialite() {
        return specialite;
    }

    public void setSpecialite(String specialite) {
        this.specialite = specialite;
    }

    public String getNiveauUniversitaire() {
        return niveauUniversitaire;
    }

    public void setNiveauUniversitaire(String niveauUniversitaire) {
        this.niveauUniversitaire = niveauUniversitaire;
    }

    @XmlTransient
    public Collection<Etudier> getEtudierCollection() {
        return etudierCollection;
    }

    public void setEtudierCollection(Collection<Etudier> etudierCollection) {
        this.etudierCollection = etudierCollection;
    }

    @XmlTransient
    public Collection<Exiger4> getExiger4Collection() {
        return exiger4Collection;
    }

    public void setExiger4Collection(Collection<Exiger4> exiger4Collection) {
        this.exiger4Collection = exiger4Collection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (specialite != null ? specialite.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Specialite)) {
            return false;
        }
        Specialite other = (Specialite) object;
        if ((this.specialite == null && other.specialite != null) || (this.specialite != null && !this.specialite.equals(other.specialite))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Specialite[ specialite=" + specialite + " ]";
    }
    
}
